package no.uib.hplims.models;

import javax.persistence.Entity;

import org.vaadin.appfoundation.persistence.data.AbstractPojo;

@Entity
public class BlastSearch extends AbstractPojo {

	private static final long serialVersionUID = 2385395835063551198L;

	/**
	 * Denotes whether this blast search is a search for a new sequence or a
	 * sequence that already exists in the DB.
	 */
	public static final String BLAST_SEARCH_NEW = "New";

	/**
	 * Denotes whether this blast search is a search for a new sequence or a
	 * sequence that already exists in the DB.
	 */
	public static final String BLAST_SEARCH_UPDATE = "Update";

	private String jobID = null;

	private String query = null;

	private MyOrder order = null;

	private String species = null;

	private boolean submitted = false;

	private String searchMode = null;

	public BlastSearch() {

	}

	public BlastSearch(String query, MyOrder order, String species, String mode) {
		this.query = query;
		this.order = order;
		this.species = species;
		this.submitted = false;
		this.searchMode = mode;
	}

	public BlastSearch(String jobID, String query, MyOrder order,
			String species, String mode) {
		this.jobID = jobID;
		this.query = query;
		this.order = order;
		this.species = species;
		this.searchMode = mode;

		if (jobID != null && !jobID.isEmpty()) {
			this.submitted = true;
		}
	}

	public String getJobID() {
		return jobID;
	}

	public void setJobID(String jobID) {
		this.jobID = jobID;
		if (jobID != null && !jobID.isEmpty()) {
			submitted = true;
		}
	}

	public String getQuery() {
		return query;
	}

	public void setQuery(String query) {
		this.query = query;
	}

	public MyOrder getOrder() {
		return order;
	}

	public void setOrder(MyOrder order) {
		this.order = order;
	}

	public boolean isSubmitted() {
		return submitted;
	}

	public void setSubmitted(boolean submitted) {
		this.submitted = submitted;
	}

	public String getSearchMode() {
		return searchMode;
	}

	public void setSearchMode(String searchMode) {
		this.searchMode = searchMode;
	}

	public String getSpecies() {
		return species;
	}

	public void setSpecies(String species) {
		this.species = species;
	}

}
